//Francisco "Kiko" Olvera
//Artifacts spawn on tiles
//Artifacts are picked up by players
//Artifacts disappear when picked up
//Every artifact is paired with a card
//Artifact.h

#include "Artifact.h"
#include "Mesh.h"
#include "Tile.h"
//#include "Material.h"

Artifact::Artifact()
{
	mat = new Material;
}

void Artifact::Init(int num, Mesh* a_mesh)
{
	texNum = num;
	mesh = a_mesh;
	taken = false;
}

void Artifact::setTile(Tile* a_tile)
{
	tile = a_tile;
}

void Artifact::LoadTexture(char* name)
{
	//mesh->LoadNextTexture(name);
	mesh->LoadTexture(texNum, name);
}

void Artifact::Draw(float X, float Z)
{
	if(!taken)
		mesh->Draw(texNum, X, Z);
}

void Artifact::Take()
{
	taken = true;
}

void Artifact::alterMatColors()
{
	mat->changeCrazyColors();
	mat->setCrazyMat();
}
D3DMATERIAL9 Artifact::getMaterial()
{
	return mat->getMaterial();
}